package com.reborn.mall.api.service;

import com.github.pagehelper.PageInfo;
import com.reborn.mall.api.model.entity.BaseEntity;
import com.reborn.mall.api.model.qo.PageQO;

import java.util.List;

/**
 * Service 基类
 *
 * @author wu.yue
 * @since 2020/1/18
 */
public interface BaseService<T extends BaseEntity> {

    T insert(T entity);

    T insertSelective(T entity);

    int insertBatch(List<T> entities);

    T findById(Long id);

    T findOne(T entity);

    List<T> findAll();

    List<T> find(T entity);

    PageInfo<T> findPage(PageQO<T> req);

    PageInfo<T> findPage(int pageNum, int pageSize);

    int updateById(T entity);

    int updateByIdSelective(T entity);

    int deleteById(Long id);

    int delete(T entity);
}
